package com.tdam2011.grupo06.model;

import android.app.Activity;
import android.provider.ContactsContract;

import com.tdam2011.grupo06.R;

public class Email 
{
	private String mail;
	private int tipo;
	private int id;

	public Email(int i, String m, int ti)
	{
		id = i;
		mail = m;
		tipo = ti;
	}
	
	public Email()
	{
		id = 0;
		mail = "";
		tipo = 0;
	}
	
	public int getId() {
		return id;
	}

	public void setId(int i) {
		this.id = i;
	}
	
	public int getTipo() {
		return tipo;
	}

	public void setTipo(int tipo) {
		this.tipo = tipo;
	}
	
	public String getMail() {
		return mail;
	}

	public void setMail(String m) {
		this.mail = m;
	}
	public String getTipoString(Activity caller)
	{
		switch (tipo)
		{
			case ContactsContract.CommonDataKinds.Email.TYPE_CUSTOM:
			return caller.getResources().getString(R.string.TYPE_CUSTOM);
			case ContactsContract.CommonDataKinds.Email.TYPE_HOME:
				return caller.getResources().getString(R.string.TYPE_HOME);
			case ContactsContract.CommonDataKinds.Email.TYPE_WORK:
				return caller.getResources().getString(R.string.TYPE_WORK);
			case ContactsContract.CommonDataKinds.Email.TYPE_OTHER:
				return caller.getResources().getString(R.string.TYPE_OTHER);
			case ContactsContract.CommonDataKinds.Email.TYPE_MOBILE:
				return caller.getResources().getString(R.string.TYPE_MOBILE);
			default:
				return"";
		
		}
	}

}
